home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / gemfsc15.lzh / AESSRC14.LZH / AESUTRS5.S < prev    next >
Text File  |  1989-09-18  |  2KB  |  67 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*  09/18/89  v1.3
  7. ;*            This module is new with this release.
  8. ;*========================================================================
  9.  
  10. ;*************************************************************************
  11. ;*
  12. ;* AESUTRS4.S - Resource-related Utilities 3 of n.
  13. ;*  Non-standard utility functions.
  14. ;*
  15. ;*************************************************************************
  16.  
  17.           .include  "gemfast.sh"
  18.  
  19. ;-------------------------------------------------------------------------
  20. ; rsc_sspec    - Set ob_spec value from an object within a tree.
  21. ; rsc_spointer - Set pointer to single string within a tree.
  22. ;
  23. ;               This function sets one string pointer/ob_spec from within
  24. ;               a resource tree.  It knows the difference between text and 
  25. ;               non-text objects, and sets the ob_spec or te_ptext value
  26. ;               as appropriate.  It also understands INDIRECT objects.
  27. ;
  28. ;               This routine is named both sspec and spointer only for
  29. ;               consistancy in naming:  since there are gspec and gpointer
  30. ;               routines, it seems appropriate to have both set routines.
  31. ;
  32. ;  void rsc_sspec(tree, object, obspec_value);
  33. ;  void rsc_sstrings(tree, object, pointer);                                    
  34. ;-------------------------------------------------------------------------
  35.  
  36. _rsc_sspec::
  37. _rsc_spointer::
  38.  
  39.           .cargs    #4,.ptree.l,.object,.newspec.l
  40.  
  41.           move.l    .ptree(sp),a0
  42.           move.w    .object(sp),d2
  43.           muls      #OBJ_SIZ,d2
  44.  
  45.           lea       ob_spec(a0,d2.l),a1 ; Get ob_spec.
  46.           btst.b    #0,ob_flags(a0,d2.l); Is INDIRECT flag set?
  47.           beq.s     .notind             ; Nope, ob_spec is all set.
  48.           move.l    (a1),a1             ; Yep, get real ob_spec.
  49. .notind:
  50.           move.w    ob_type(a0,d2.l),d1 ; Get ob_type.
  51.           cmp.b     #G_TEXT,d1
  52.           beq.s     .text
  53.           cmp.b     #G_BOXTEXT,d1
  54.           beq.s     .text
  55.           cmp.b     #G_FTEXT,d1
  56.           beq.s     .text
  57.           cmp.b     #G_FBOXTEXT,d1
  58.           bne.s     .string
  59. .text:  
  60.           move.l    (a1),a1             ; Get te_ptext
  61. .string:
  62.           move.l    .newspec(sp),(a1)   ; Set new ob_spec/te_ptext value.
  63.           rts
  64.           
  65. ;         end of code
  66.  
  67.